<?php

namespace App\Modules\CodeDesigner\Prototype;

class Resume
{
    /**
     * @var
     */
    public $name;

    /**
     * @var
     */
    public $sex;

    /**
     * @var WorkExperience
     */
    public $work;

    public function __construct(string $name, string $sex)
    {
        $this->name = $name;
        $this->sex = $sex;
        $this->work = new WorkExperience();
    }

    /**
     * @return string
     */
    public function display() : string
    {
        return  "姓名：{$this->name}, 性别：{$this->sex}, 工作经验：{$this->work->workDate} -- {$this->work->work}" . PHP_EOL;
    }

    /**
     * @param string $date
     * @param string $work
     * @return void
     */
    public function setWork(string $date, string $work)
    {
        $this->work->date = $date;
        $this->work->work = $work;
    }
}